import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

const Home = () => import("views/home/Home.vue");
const Category = () => import("views/category/Category.vue");
const Profile = () => import("views/profile/Profile.vue");
const Cart = () => import("views/cart/Cart.vue");
const NotFound = () => import("components/common/error/NotFound.vue");

const routes = [
  {
    path: "",
    redirect: {name:"home"}
  },
  {
    path: "/home",
    name:"home",
    component: Home
  },
  {
    path: "/category",
    name:"category",
    component: Category
  },
  {
    path: "/cart",
    name: "cart",
    component: Cart
  },
  {
    path: "/profile",
    name: "profile",
    component: Profile
  },
  {
    path: "*",
    component: NotFound
  }
];

export default new Router({
  routes: routes,
  mode: "history"
});
